Function Reference

_TS_Wrapper_TriggerDateTime

Creates a date/time based Trigger.

#Include <TaskScheduler.au3>
_TS_Wrapper_TriggerDateTime($oTaskDefinition, $iTriggerType, $iDoW, $iInterval, $sStart[, $sEnd = ""])

 

Parameters

$oTaskDefinition Task Definition object as returned by _TS_Wrapper_TaskCreate
$iTriggerType Type of Trigger to use. Only supports $TASK_TRIGGER_TIME, $TASK_TRIGGER_DAILY and $TASK_TRIGGER_WEEKLY
$iDoW A bitwise mask that indicates the days of the week on which the Task runs. Possible values:
Sunday - 1, Monday - 2, Tuesday - 4, Wednesday - 8, Thursday - 16, Friday - 32, Saturday - 64. 10 means: Run the schedule on Monday and Wednesday
$iInterval The interval between the days ($TASK_TRIGGER_DAILY) or weeks ($TASK_TRIGGER_WEEKLY) in the schedule
$sStart The date and time when the Trigger is activated. Format: YYYY-MM-DDTHH:MM:SS(+-)HH:MM. See Remarks
$sEnd [optional] The date and time when the Trigger is deactivated. Format: YYYY-MM-DDTHH:MM:SS(+-)HH:MM. See Remarks

 

Return Value

Success: Object of the created schedule
Failure: Returns 0 and sets @error
    3101 - Invalid $iTriggerType specified. Has to be $TASK_TRIGGER_TIME, $TASK_TRIGGER_DAILY or $TASK_TRIGGER_WEEKLY
    3102 - Error returned when creating the Trigger object. @extended is set to the COM error code
    3103 - Error setting property StartBoundary. Please check the correct format as described above. @extended is set to the COM error code
    3104 - Error setting property EndBoundary. Please check the correct format as described above. @extended is set to the COM error code
    3105 - Error setting property ExecutionTimeLimit. Please check the correct format as described above. @extended is set to the COM error code
    3106 - Error setting property DaysOfWeek. Please check the correct format. @extended is set to the COM error code
    3107 - Error setting property Weeksinterval. Please check the correct format. @extended is set to the COM error code
    3108 - Error setting property DaysInterval. Please check the correct format. @extended is set to the COM error code
    3109 - Parameter $oTaskDefinition is not an object or not an ITaskDefinition object
    3110 - Error returned when accessing the Triggers collection. @extended is set to the COM error code

 

Remarks

The (+-)HH:MM section describes the time zone as a certain number of hours ahead or behind Coordinated Universal Time (Greenwich Mean Time).

 

Related

 

Example


#Region ;**** Directives created by AutoIt3Wrapper_GUI ****
#AutoIt3Wrapper_Res_requestedExecutionLevel=asInvoker
#AutoIt3Wrapper_AU3Check_Stop_OnWarning=y
#AutoIt3Wrapper_AU3Check_Parameters=-d -w 1 -w 2 -w 3 -w 4 -w 5 -w 6 -w 7
#EndRegion ;**** Directives created by AutoIt3Wrapper_GUI ****

#include <MsgBoxConstants.au3>

MsgBox($MB_ICONINFORMATION, "Task Scheduler UDF", "Please check example script _TS_Wrapper_TaskCreate.au3 for an example!")